#! /bin/bash

for exe in 2d-9p 2d-heat 3d-27p 3d-heat 3d-pois 
do
    rm $exe.txt
    for i in `seq 1 4 101`;
    do
        echo  "np = $i" >> ./$exe.txt
        if [[ $exe =~ "2d" ]]; then
            for n in `seq 20 20 200`;
            do
                mpirun -np $i ./$exe $n $n 1000 1 1 >> ./$exe.txt
            done
            for n in `seq 200 100 1000`;
            do
                mpirun -np $i ./$exe $n $n 1000 1 1 >> ./$exe.txt
            done
            for n in `seq 1000 500 4000`;
            do
                mpirun -np $i ./$exe $n $n 1000 1 1 >> ./$exe.txt
            done
            for n in `seq 5000 1000 10000`;
            do
                mpirun -np $i ./$exe $n $n 1000 1 1 >> ./$exe.txt
            done
        fi

        if [[ $exe =~ "3d" ]]; then
            for n in `seq 10 10 100`;
            do
                mpirun -np $i ./$exe $n $n $n 1000 1 1 1 >> ./$exe.txt
            done
            for n in `seq 100 20 200`;
            do
                mpirun -np $i ./$exe $n $n $n 1000 1 1 1 >> ./$exe.txt
            done
            for n in `seq 200 30 320`;
            do
                mpirun -np $i ./$exe $n $n $n 1000 1 1 1 >> ./$exe.txt
            done
        fi
    done
done
